﻿using GameCreator.Core;
using Gp.Scripts.Core;
using Gp.Scripts.GameLogic;
using Gp.Scripts.Data;
using UnityEngine;

namespace Gp.GCX {
    [AddComponentMenu("")]
    public class MoveDoorAc : IAction {
        public DoorDynamicObject door;
 
        // public string characterName;

        public override bool InstantExecute(GameObject target, IAction[] actions, int index) {
            if (door == null) return true;
            door.ExecuteMoveDoor();
            return true;
        }


#if UNITY_EDITOR
        public new static string NAME = "Gp/其他/移动门";
        private const string NODE_TITLE = "{0} 移动";

        public override string GetNodeTitle()
        {
            string name = door == null ? "无" : door.name;
            return string.Format(NODE_TITLE, name);
        }

#endif
    }
}